android.ndk.native_activity

@file native_activity.h

Members

Aliases

ANativeActivity_createFunc
alias ANativeActivity_createFunc = void function(ANativeActivity* activity, void* savedState, size_t savedStateSize)

This is the function that must be in the native code to instantiate the application's native activity. It is called with the activity instance (see above); if the code is being instantiated from a previously saved instance, the savedState will be non-NULL and point to the saved data. You must make any copy of this data you need -- it will be released after you return from this function.

Enums

ANATIVEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY
enum ANATIVEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY

Flags for ANativeActivity_hideSoftInput; see the Java InputMethodManager API for documentation.

ANATIVEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT
enum ANATIVEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT

Flags for ANativeActivity_showSoftInput; see the Java InputMethodManager API for documentation.

Functions

ANativeActivity_finish
void ANativeActivity_finish(ANativeActivity* activity)

Finish the given activity. Its finish() method will be called, causing it to be stopped and destroyed. Note that this method can be called from *any* thread; it will send a message to the main thread of the process where the Java finish call will take place.

ANativeActivity_hideSoftInput
void ANativeActivity_hideSoftInput(ANativeActivity* activity, uint flags)

Hide the IME while in the given activity. Calls InputMethodManager.hideSoftInput() for the given activity. Note that this method can be called from *any* thread; it will send a message to the main thread of the process where the Java finish call will take place.

ANativeActivity_onCreate
void ANativeActivity_onCreate()

The name of the function that NativeInstance looks for when launching its native code. This is the default function that is used, you can specify "android.app.func_name" string meta-data in your manifest to use a different function.

ANativeActivity_setWindowFlags
void ANativeActivity_setWindowFlags(ANativeActivity* activity, uint addFlags, uint removeFlags)

Change the window flags of the given activity. Calls getWindow().setFlags() of the given activity. Note that this method can be called from *any* thread; it will send a message to the main thread of the process where the Java finish call will take place. See window.h for flag constants.

ANativeActivity_setWindowFormat
void ANativeActivity_setWindowFormat(ANativeActivity* activity, int format)

Change the window format of the given activity. Calls getWindow().setFormat() of the given activity. Note that this method can be called from *any* thread; it will send a message to the main thread of the process where the Java finish call will take place.

ANativeActivity_showSoftInput
void ANativeActivity_showSoftInput(ANativeActivity* activity, uint flags)

Show the IME while in the given activity. Calls InputMethodManager.showSoftInput() for the given activity. Note that this method can be called from *any* thread; it will send a message to the main thread of the process where the Java finish call will take place.

Structs

ANativeActivity
struct ANativeActivity

This structure defines the native side of an android.app.NativeActivity. It is created by the framework, and handed to the application's native code as it is being launched.

ANativeActivityCallbacks
struct ANativeActivityCallbacks

These are the callbacks the framework makes into a native application. All of these callbacks happen on the main thread of the application. By default, all callbacks are NULL; set to a pointer to your own function to have it called.

Meta